package com.chaosj.skill.prometheus.properties

import io.micrometer.prometheus.PrometheusConfig

import java.time.Duration

/**
 * @Description:
 * @author caoyangjie
 * @date 2020年01月2020/1/23日 12:06
 * @Copyright: © 赢时胜
 */
class PrometheusPropertiesConfigAdapter extends
        PropertiesConfigAdapter<PrometheusProperties> implements PrometheusConfig {

    PrometheusPropertiesConfigAdapter(PrometheusProperties properties) {
        super(properties)
    }

    @Override
    String get(String key) {
        return null
    }

    @Override
    boolean descriptions() {
        return get({PrometheusProperties p->p.isDescriptions()},{PrometheusConfig p->p.descriptions()})
    }

    @Override
    Duration step() {
        return get({PrometheusProperties p->p.getStep()},{PrometheusConfig p->p.step()})
    }

}
